﻿<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
    xmlns:ic="clr-namespace:Microsoft.Expression.Interactivity.Core;assembly=Microsoft.Expression.Interactions"
    xmlns:im="clr-namespace:Microsoft.Expression.Interactivity.Media;assembly=Microsoft.Expression.Interactions"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:sys="clr-namespace:System;assembly=mscorlib"
    xmlns:local="clr-namespace:Polaris.Windows.Controls"
    xmlns:mscorlib="clr-namespace:System;assembly=mscorlib"
    xmlns:services="clr-namespace:Polaris.Windows.Services"
    xmlns:WindowsInput="clr-namespace:WindowsInput;assembly=InputSimulator"
    >
    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="Polaris.Ui;component/Themes/QuertyKeyboard.xaml"/>
    </ResourceDictionary.MergedDictionaries>
    
    <!--AnimatedLayoutControl-->
    <Style TargetType="local:AnimatedLayoutControl">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:AnimatedLayoutControl">
                    <Grid x:Name="LayoutRoot" RenderTransformOrigin="0.5,0.5">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="LayoutStates">
                                <VisualState x:Name="BeforeLoaded">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="LayoutRoot" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Loaded">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="LayoutRoot" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.5000000" Value="1"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unloaded">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="LayoutRoot" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="0"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid Background="White">
                            <ContentPresenter Cursor="{TemplateBinding Cursor}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}"/>
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="MaxDelay" Value="00:00:01.5000000"/>
        <Setter Property="MinDelay" Value="00:00:00"/>
        <Setter Property="LoadedDelayMode" Value="Sequential"/>
        <Setter Property="UnloadedDelayMode" Value="ReverseSequential"/>
    </Style>
    <!--AnimatedLayoutControl-->

    <!--AnimatedLayoutItemsControl-->
    <Style TargetType="local:AnimatedLayoutItemsControl">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:AnimatedLayoutItemsControl">
                    <StackPanel x:Name="LayoutRoot" Orientation="Vertical">
                        <ItemsPresenter/>
                    </StackPanel>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <!--AnimatedLayoutItemsControl-->

    <!--CarouselItem-->
    <Style TargetType="{x:Type local:CarouselItem}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type local:CarouselItem}">
                    <Border Background="{TemplateBinding Background}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}">
                        <ContentPresenter/>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <!--CarouselItem-->

    <!--CarouselItemsControl-->
    <Style TargetType="{x:Type local:CarouselItemsControl}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type local:CarouselItemsControl}">
                    <Border Background="{TemplateBinding Background}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}">
                        <ItemsPresenter/>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <!--CarouselItemsControl-->

    <!--Animated Expander-->
    <Style TargetType="{x:Type local:AnimatedExpander}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type local:AnimatedExpander}">
                    <Border Background="{TemplateBinding Background}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}">
                        <ContentPresenter/>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <!--Animated Expander-->

    <!--ViewTransitionControl-->
    <Style TargetType="{x:Type local:ViewTransitionControl}">
        <Setter Property="Focusable" Value="False"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type local:ViewTransitionControl}">
                    <Grid x:Name="LayoutRoot" Opacity="0" IsEnabled="False">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="TransitionStates">
                                <VisualState x:Name="BeforeLoaded">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="LayoutRoot">
                                            <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                                        </DoubleAnimationUsingKeyFrames>
                                        <BooleanAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.IsEnabled)" Storyboard.TargetName="LayoutRoot">
                                            <DiscreteBooleanKeyFrame KeyTime="0" Value="False"/>
                                        </BooleanAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Loaded">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="LayoutRoot">
                                            <EasingDoubleKeyFrame KeyTime="0:0:1" Value="1"/>
                                        </DoubleAnimationUsingKeyFrames>
                                        <BooleanAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.IsEnabled)" Storyboard.TargetName="LayoutRoot">
                                            <DiscreteBooleanKeyFrame KeyTime="0:0:1" Value="True"/>
                                        </BooleanAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unloaded">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="LayoutRoot">
                                            <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="0"/>
                                        </DoubleAnimationUsingKeyFrames>
                                        <BooleanAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.IsEnabled)" Storyboard.TargetName="LayoutRoot">
                                            <DiscreteBooleanKeyFrame KeyTime="0" Value="False"/>
                                        </BooleanAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <ContentPresenter/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <!--ViewTransitionControl-->

    <!--FormattedTextBlock-->
    <Style TargetType="{x:Type local:FormattedTextBlock}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type local:FormattedTextBlock}" />
            </Setter.Value>
        </Setter>
        <Setter Property="Focusable" Value="False"/>
    </Style>
    <!--FormattedTextBlock-->
</ResourceDictionary>